package com.smarttest.common.beans.protolcol;

import java.util.Date;

/**
 * 最后一次位置，相对Location有扩展属性
 * @author harry.min(minzaohua@chinawayltd.com)
 *
 */
public class LocationLast extends Location {
	private static final long serialVersionUID = -4688078306158945065L;
	
	private int gspeed;				// gps真实速度
	private Date gpstime;			// gps定位的时间
	protected Date movetime;		// 最后一次移动的时间
	protected int movetimes;		// 本次运行时间，秒
	private Date speedtime;			// 超速开始时间
	private int status;				// 状态,0/断线，1/在线,2/心跳
	private int rangeid;			// 设备当前所有范围的ID
	private int pathid;				// 设备当前
	private int roadLevel;			// 所在路段类型
	private Date roadTime;
	private String roadName;
	
	protected String properties;	// 其它状态，根据设备不同而不同
	private GpsStatus gstatus;		// 解析后的状态
	
	private String cityCode;		// 当前行政区编码
	
	public LocationLast() {
	}
	
	public LocationLast(Date time, double lat, double latw, double lng, double lngw, int speed, int course, int distance) {
		super(time, lat, latw, lng, lngw, speed, course, distance);
	}
	
	public LocationLast(Location lct) {
		if (lct == null) return;
		this.mactype = lct.getMactype();		//设备类型
		this.imei = lct.getImei();
		this.time = lct.getTime();
		this.lat = lct.getLat();
		this.lng = lct.getLng();
		this.latw = lct.getLatw();
		this.lngw = lct.getLngw();
		this.speed = lct.getSpeed();
		this.course = lct.getCourse();
		this.distance = lct.getDistance();
		this.voltage = lct.getVoltage();		// 电压
		this.gsm = lct.getGsm();				// GSM信号
		this.gpsStatus = lct.getGpsStatus();	// 定位状态
		this.gpsSignal = lct.getGpsSignal();
		this.lbsCountry = lct.getLbsCountry();	// LBS信息，国家
		this.lbsNetwork = lct.getLbsNetwork();	// 网络
		this.lbsArea = lct.getLbsArea();		// 区域
		this.lbsCellid = lct.getLbsCellid();	// 基站
		this.pyBlank = lct.getPyBlank();
		if (lct instanceof LocationLast) {
			LocationLast l = (LocationLast) lct;
			this.speedtime = l.getSpeedtime();
			this.status = l.getStatus();
			this.properties = l.getProperties();
		}
	}
	
	public Date getRoadTime() {
		return roadTime;
	}

	public void setRoadTime(Date roadTime) {
		this.roadTime = roadTime;
	}

	public String getRoadName() {
		return roadName;
	}

	public void setRoadName(String roadName) {
		this.roadName = roadName;
	}
	
	public Date getSpeedtime() {
		return speedtime;
	}

	public void setSpeedtime(Date speedtime) {
		this.speedtime = speedtime;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getProperties() {
		return properties;
	}

	public void setProperties(String properties) {
		this.properties = properties;
	}

	public Date getMovetime() {
		return movetime;
	}

	public int getMovetimes() {
		return movetimes;
	}

	public void setMovetime(Date movetime) {
		this.movetime = movetime;
	}

	public void setMovetimes(int movetimes) {
		this.movetimes = movetimes;
	}

	public int getRangeid() {
		return rangeid;
	}

	public void setRangeid(int rangeid) {
		this.rangeid = rangeid;
	}

	public int getPathid() {
		return pathid;
	}

	public void setPathid(int pathid) {
		this.pathid = pathid;
	}

	public Date getGpstime() {
		return gpstime;
	}

	public void setGpstime(Date gpstime) {
		this.gpstime = gpstime;
	}

	public int getGspeed() {
		return gspeed;
	}

	public void setGspeed(int gspeed) {
		this.gspeed = gspeed;
	}

	public GpsStatus getGstatus() {
		return gstatus;
	}

	public void setGstatus(GpsStatus gstatus) {
		this.gstatus = gstatus;
	}

	public int getRoadLevel() {
		return roadLevel;
	}

	public void setRoadLevel(int roadLevel) {
		this.roadLevel = roadLevel;
	}

	public String getCityCode() {
		return cityCode;
	}

	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}
}
